//
//  MYFactoryManager.h
//  GoHiking_app
//
//  Created by qf on 15/10/13.
//  Copyright (c) 2015年 qf. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseTableView.h"
//懒加载专用
@interface MYFactoryManager : NSObject

#pragma 高宽度的适应计算
/**高度自适应*/
+ (CGFloat)heightForString:(NSString *)string fontSize:(CGFloat)fontSize andWidth:(CGFloat)width;
/**宽度自适应*/
+ (CGFloat)widthForString:(NSString *)string fontSize:(CGFloat)fontSize andHeight:(CGFloat)height;

#pragma 时间计算
//时间计算
+ (NSString *)getStartTimeDate:(double)dateTime format:(NSString *)format;
+ (NSString *) returnUploadTime:(NSString *)timeStr;
//返回时间戳
+ (NSString *)returnTimestamp:(NSString *)timeStr;

#pragma mark 字符与字典的转换
//字符串转字典与字典转字符串
+ (NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString;
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
+ (NSString*)arrayToJson:(NSArray *)arr;
+ (NSArray *)parseJSONStringToNSArray:(NSString *)JSONString;

#pragma mark GTMBase64
//编码和解码base64
+(NSString *)GTMEncodeTest:(NSString *)originStr;
+(NSString *)GMTDecodeTest:(NSString *)decodeStr;

//修改图片尺寸
+ (NSData *)imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth;

//判断对象是否为空
+ (NSString *)returnRealValue:(id)sendValue;

#pragma 各种格式检验
//获取部分显示手机格式
+ (NSString *)getPhoneText:(NSString *)phoneNum;
//手机格式
+ (BOOL)phoneNum:(NSString *) textString;
//数字检验
+ (BOOL)validateNumber:(NSString*)number;
//判断输入的是否是表情
+(BOOL)isContainsEmoji:(NSString *)string;
//判断身份证号
+ (BOOL) validateIdentityCard: (NSString *)identityCard;
//判断金钱输入
+ (BOOL)ConformToTheMoneyInputString:(NSString *)string shouldChangeCharactersInRange:(NSRange)range currtentTextField:(UITextField *)textField;

#pragma 缓存文件处理
//计算缓存文件的大小
+(float)getCacheSize;
//清楚缓存文件
+(void)clearCache;

#pragma 登录页的快速跳转
//调到登录页
+ (BOOL)pushVCToLoginController:(UIViewController *)selfVC  withTableView:(BaseTableView *)tableView;
+ (BOOL)quickPushVCToLoginController:(UIViewController *)selfVC;

//判断系统版本
+(int)osVersion;
//更新系统版本
+ (void)updateSystemVersion:(NSString *)appId success:(SuccessBlock)successBlock fail:(FailBlock)failBlock;

+ (UILabel *)versionLabel;

//登陆里的控件创建
+ (UITextField *)createTextField:(CGRect)frame withLeftView:(UIView *)leftView withPlaceholder:(NSString *)placeholder withDelegate:(id)target;

//登陆按钮
+ (UIButton *)createBtn:(CGRect)frame withTitle:(NSString *)title target:(id)target withSel:(SEL)sel withTitleColor:(UIColor *)color withBackColor:(UIColor *)backColor;

// 设置本地通知
+ (void)registerLocalNotification:(NSDate*)alertDate alertBody:(NSString *)alertBody userDict:(NSDictionary *)userDict;
// 取消某个本地推送通知
+ (void)cancelLocalNotificationWithKey:(NSString *)key;

#pragma mark -- 登陆界面控件
//登陆
+ (UIView *)createLoginView:(CGRect)frame withCore:(BOOL)isCore;
//登陆小控件
+ (UILabel *)createLabel:(CGRect)frame withTitle:(NSString *)title withFont:(float)fontSize;
//发布页面输入框
+ (UITextField *)createTextField:(CGRect)frame withPlaceholder:(NSString *)placeholder withLeftViewTitle:(NSString *)title withLeftViewTitleColor:(UIColor *)titleColor withLeftFont:(float)fontSize withLeftViewWidth:(float)width withDelegate:(id)target;

+ (void)showFrameAnimationBubble:(UIButton *)sender;
+ (void)hideBubbleFrame:(float)intetval;
@end
